<script type="text/javascript">
$(document).ready(function(){
	$("#frmSendOrder").submit(function(){
		var msg = "Bạn chưa điền: \n";
		if($("#fullname").attr("value") == ""){
			msg +="\t\tHọ tên.\n";
		}
		if($("#phone").attr("value") == ""){
			msg +="\t\tSố điện thoại.\n";
		}
		if($("#email").attr("value") == ""){
			msg +="\t\tEmail.\n";
		}
		if($("#yahoo").attr("value") == ""){
			msg +="\t\tTài khoản yahoo.\n";
		}
		if($("#address").attr("value") == ""){
			msg +="\t\tĐịa chỉ.";
		}
		var total_product = document.getElementById("total_product").innerHTML;
		if(msg != "Bạn chưa điền: \n"){
			alert(msg);
			return false;
		}else if( total_product=='0'){
			alert("Bạn chưa chọn mặt hàng nào để mua!");
			return false;
		}
	});
});
</script>
<div id="main_content">
        	<div id="top">
            	<div id="sub_banner">
            		<?php Helper_HtmlRender::renderImageOrFlash($this->banners[1]->image, 723, 267, 'Thiết bị văn phòng Cường Phú')?>
            	</div>
                <div id="contact_banner">
                	<?php Helper_HtmlRender::renderImageOrFlash($this->banners[2]->image, 723, 76, 'Thiết bị văn phòng Cường Phú')?>
                </div>
            </div><!-- end top main_content block-->
            <?php if(isset($this->message)){
            echo '<div id="message">'.$this->message.'</div>';
            }else {?>
           <div id="order_block" >
            	<div id="title">Thông tin khách hàng</div>
            	<form id="frmSendOrder" method="post" action="">
                <div id="cus_info">
                	<div class="cus_info_field"><label>Họ và tên</label><input class="text_box_order" type="text" name="fullname" id="fullname" />(*)</div>
                    <div class="cus_info_field"><label>Số điện thoại</label><input class="text_box_order" type="text" name="phone" id="phone" />(*)</div>
                    <div class="cus_info_field"><label>Địa chỉ email</label><input class="text_box_order" type="text" name="email" id="email" />(*)</div>
                    <div class="cus_info_field"><label>Nick yahoo</label><input class="text_box_order" type="text" name="yahoo" id="yahoo" />(*)</div>
                    <div class="cus_info_field"><label>Địa chỉ</label><input class="text_box_order" type="text" name="address" id="address" />(*)</div>
                    <div class="cus_info_field"><label>Ghi chú</label><textarea  class="textarea_order" name="textare_note" id="textare_note"></textarea></div>
                     
                </div>
                <div id="sale_policy"></div>
                <div id="clear" >
	                <input type="submit" name="submit_button" id="submit_button_order" value="Gửi"/>
	            </div>    
	            </form>
           </div>
          <?php }?>      
</div><!-- end main_content block -->

<div id="right">
        	<div id="search_box">
        		<form id="frmSearch" action="<?php echo $this->url(array(), "search");?>" method="get">
        			<input type="text" onclick="value='';"  id="keyword" name="keyword" value="Tìm sản phẩm..."/>
                	<input type="submit" id="submit_button" value="Tìm kiếm" />
        		</form>
            	
            </div><!-- end search_block-->
            <div id="cart_box">
            	<div id="title_cart"><a href="<?php echo $this->url(array(),"cart");?>">Giỏ hàng của bạn</a></div>
                <div class="cart_info">
                	<span class="left_info">Số sản phẩm:&nbsp; </span>
                    <span class="right_info"><?php echo $this->totalCartProduct;?></span>
                </div>
                <div class="cart_info">
                	<span class="left_info">Tổng tiền:&nbsp;</span>
                    <span class="right_info"><?php echo number_format($this->totalCartPrice);?> VND</span>
                </div>
            </div> <!-- end cart_block -->
            <?php
            //lấy dữ liệu để điền vào 2 box hỗ trợ trực tuyến
            $arrSalers = array();
            $arrTechnicians = array(); 
            foreach ($this->supporters as $supporter){
            	if($supporter->type == 0){
            		$arrSalers[] = $supporter;
            	}else{
            		$arrTechnicians[] = $supporter;
            	}
            }
            
                  
            ?>
            <div class="right_box">
            	<div class="title_box">
                	<div class="text_title_box">Bán hàng trực tuyến</div>
                    <div class="phone_title_box">(04) 35 68 36 99</div>
                </div>
                <?php $count_business =count($arrSalers);
               	if($count_business>0){
               	for( $i=0;$i<$count_business;$i++){?>
               	 <div class="supporter">
                	<div class="info_supporter">
                    	<div class="name_supporter">
                        	<a href="ymsgr:SendIM?<?php echo $arrSalers[$i]->yahoo_account;?>"  title="Contact to supporter!">
         						<?php echo $arrSalers[$i]->name;?>
                            </a>
                            </div>
                       	<div class="phone_supporter"><?php echo $arrSalers[$i]->phone;?></div>
                        <div class="email_supporter"><?php echo $arrSalers[$i]->email;?></div>
                        
                    </div>
                    <div class="online_icon"><img  src="http://opi.yahoo.com/online?u=<?php echo $arrSalers[$i]->yahoo_account;?>&m=g&t=1" border="0"></div>
                    <?php if($i+2 <= $count_business){?><div class="line"></div><?php } ?>
                </div>
               <?php }
               	 } ?>
                
               
            </div><!-- end right_box-->           
            <div class="right_box">
            	<div class="title_box">
                	<div class="text_title_box">Hỗ trợ kỹ thuật</div>
                    <div class="phone_title_box">(04) 66 84 87 86</div>
                </div>
                <?php $count_technical =count($arrTechnicians);
               	if($count_technical>0){
               	for( $i=0;$i<$count_technical;$i++){?>
               	 <div class="supporter">
                	<div class="info_supporter">
                    	<div class="name_supporter">
                        	<a href="ymsgr:SendIM?<?php echo $arrTechnicians[$i]->yahoo_account;?>"  title="Contact to supporter!">
         						<?php echo $arrTechnicians[$i]->name;?>
                            </a>
                            </div>
                        <div class="phone_supporter"><?php echo $arrTechnicians[$i]->phone;?></div>
                        <div class="email_supporter"><?php echo $arrTechnicians[$i]->email;?></div>
                        
                    </div>
                    <div class="online_icon"><img  src="http://opi.yahoo.com/online?u=<?php echo $arrTechnicians[$i]->yahoo_account;?>&m=g&t=1" border="0"></div>
                    <?php if($i+2 <= $count_technical){?><div class="line"></div><?php } ?>
                </div>
               <?php }
               	 } ?>
            </div><!-- end right_box-->
            <?php
            echo $this->partial("include/tags.phtml", array("tags" => $this->tags));
            ?>
</div> <!-- end right block --> 
<div id="clear"></div>  